import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/vue-element-Role/routes',
    method: 'get'
  })
}

export function getRoles() {
  return request({
    url: '/role/queryall',
    method: 'get'
  })
}

export function addRole(data) {
  return request({
    url: '/Role/Create',
    method: 'post',
    data
  })
}

export function createRole(data) {
  return request({
    url: '/Role/Create',
    method: 'post',
    data
  })
}

export function updateRole(params, data) {
  return request({
    url: '/Role/Update',
    method: 'post',
    params,
    data
  })
}

export function pageRole(params) {
  return request({
    url: '/Role/page',
    method: 'get',
    params
  })
}

export function deleteRole(params) {
  return request({
    url: '/Role/Delete',
    method: 'get',
    params
  })
}

export function getRole(params) {
  return request({
    url: '/Role/get',
    method: 'get',
    params
  })
}

export function GetTreeIds(params) {
  return request({
    url: '/Role/GetTreeIds',
    method: 'get',
    params
  })
}

export function SetPermission(params, data) {
  return request({
    url: '/Role/SetPermission',
    method: 'post',
    params,
    data
  })
}
